'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    if (ctx.isAuthenticated()) {
      ctx.body = 'hi, egg';
    } else {
      ctx.status = 401;
      ctx.body = 'You have not logged in. Go to /passport/gitee to continue.';
    }
  }
}

module.exports = HomeController;
